package com.atguigu.gmall.product.client;

import com.atguigu.gmall.model.product.BaseCategoryView;
import com.atguigu.gmall.model.product.SkuInfo;
import com.atguigu.gmall.model.product.SpuSaleAttr;
import com.atguigu.gmall.product.client.impl.ProductFeignClientImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @ author     ：廖传港
 * @ date       ：Created in 2020/12/25 21:08
 * @ description：
 * @ modified By：
 * @ ersion:
 */
@FeignClient(name = "service-product",fallback = ProductFeignClientImpl.class)
public interface ProductFeignClient {


    @ApiOperation("查询三级分类")
    @GetMapping("api/product/inner/getBaseCategoryView/{category3Id}")
    public BaseCategoryView getBaseCategoryView(@PathVariable Long category3Id);

    @ApiOperation("获取sku基本信息与图片信息")
    @GetMapping("api/product/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable Long skuId);

    @ApiOperation("获取价格信息")
    @GetMapping("api/product/inner/getSkuPrice/{skuId}")
    public BigDecimal getSkuPrice(@PathVariable Long skuId);


    @ApiOperation("商品详情之查询销售属性及选中")
    @GetMapping("api/product/inner/getSpuSaleAttrAndChecked/{spuId}/{skuId}")
    public List<SpuSaleAttr> getSpuSaleAttrAndChecked(@PathVariable Long spuId,
                                                      @PathVariable Long skuId);
    @ApiOperation("商品详情之查询销售属性及选中")
    @GetMapping("api/product/inner/getSaleAttrValuesBySpu/{spuId}/")
    public Map getSaleAttrValuesBySpu(@PathVariable Long spuId);

    @ApiOperation("查询所有分类视图对象集合")
    @GetMapping("api/product/inner/getBaseCategoryViewList")
    public List<BaseCategoryView> getBaseCategoryViewList();
}
